const columnsConfig = ['selection','operation'
                      ,'sid'
                      ,'tradeCode'
                      ,'emsNo'
                      ,'billListNo'
                      ,'actlPassQty'
                      ,'classifyMark'
                      ,'codeTS'
                      ,'copGNo'
                      ,'curr'
                      ,'dataMark'
                      ,'decPrice'
                      ,'decTotal'
                      ,'destinationCountry'
                      ,'districtCode'
                      ,'districtPostCode'
                      ,'dutyMode'
                      ,'entryGNo'
                      ,'exgVersion'
                      ,'factor1'
                      ,'factor2'
                      ,'factorWt'
                      ,'gModel'
                      ,'gName'
                      ,'gNo'
                      ,'grossWt'
                      ,'headId'
                      ,'indbTime'
                      ,'insertTime'
                      ,'insertUser'
                      ,'modifyMark'
                      ,'netWt'
                      ,'note'
                      ,'originCountry'
                      ,'passportUsedQty'
                      ,'preSeqNo'
                      ,'qty'
                      ,'qty1'
                      ,'qty2'
                      ,'rotateGNo'
                      ,'seqNo'
                      ,'serialNo'
                      ,'unit'
                      ,'unit1'
                      ,'unit2'
                      ,'updateTime'
                      ,'updateUser'
                      ,'usdPrice'
                      ,'useType'
]
const excelColumnsConfig = [
                       'sid',
                       'tradeCode',
                       'emsNo',
                       'billListNo',
                       'actlPassQty',
                       'classifyMark',
                       'codeTS',
                       'copGNo',
                       'curr',
                       'dataMark',
                       'decPrice',
                       'decTotal',
                       'destinationCountry',
                       'districtCode',
                       'districtPostCode',
                       'dutyMode',
                       'entryGNo',
                       'exgVersion',
                       'factor1',
                       'factor2',
                       'factorWt',
                       'gModel',
                       'gName',
                       'gNo',
                       'grossWt',
                       'headId',
                       'indbTime',
                       'insertTime',
                       'insertUser',
                       'modifyMark',
                       'netWt',
                       'note',
                       'originCountry',
                       'passportUsedQty',
                       'preSeqNo',
                       'qty',
                       'qty1',
                       'qty2',
                       'rotateGNo',
                       'seqNo',
                       'serialNo',
                       'unit',
                       'unit1',
                       'unit2',
                       'updateTime',
                       'updateUser',
                       'usdPrice',
                       'useType',
  ]
const columns = {
  data() {
    return {
      totalColumns: [
        {
          type: 'selection',
          width: 60,
          align: 'center',
          key: 'selection',
        },
        {
          title: '操作',
          width: 120,
          align: 'center',
          render: (h,params) => {
            return h('div', [
              h('a', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  marginRight: '15px'
                },
                on: {
                  click: () => {
                    this.gridConfig.selectData = params.row
                    this.handleEdit()
                  }
                }
              }, '编辑'),
              //添加查看按钮
              h('a', {
                props: {
                  type: 'primary',
                },
                style: {},
                on: {
                  click: () => {
                    this.gridConfig.selectData = params.row
                    this.handleView()
                  },
                },
              }, '查看')
              ]);
          },
          key: 'operation'
        },
        {
          title: '商品编码',
          minWidth: 120,
          align: 'center',
          key: 'codeTS',
        },
        {
          title: '料号',
          minWidth: 120,
          align: 'center',
          key: 'copGNo',
        },
        {
          title: '币制',
          minWidth: 120,
          align: 'center',
          key: 'curr',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.curr_outdated, params.row.curr))
          }
        },
        {
          title: '申报单价',
          minWidth: 120,
          align: 'center',
          key: 'decPrice',
        },
        {
          title: '申报总价',
          minWidth: 120,
          align: 'center',
          key: 'decTotal',
        },
        {
          title: '最终目的国（地区）',
          minWidth: 120,
          align: 'center',
          key: 'destinationCountry',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.country_outdated, params.row.destinationCountry))
          }
        },
        {
          title: '境内目的地-行政区',
          minWidth: 120,
          align: 'center',
          key: 'districtPostCode',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.post_area, params.row.districtPostCode))
          }
        },
        {
          title: '征免方式',
          minWidth: 120,
          align: 'center',
          key: 'dutyMode',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.levymode, params.row.dutyMode))
          }
        },
        {
          title: '报关单商品序号',
          minWidth: 120,
          align: 'center',
          key: 'entryGNo',
        },
        {
          title: '单耗版本号',
          minWidth: 120,
          align: 'center',
          key: 'exgVersion',
        },
        {
          title: '规格型号',
          minWidth: 120,
          align: 'center',
          key: 'gModel',
        },
        {
          title: '商品名称',
          minWidth: 120,
          align: 'center',
          key: 'gName',
        },
        {
          title: '备案序号',
          minWidth: 120,
          align: 'center',
          key: 'gNo',
        },
        {
          title: '毛重',
          minWidth: 120,
          align: 'center',
          key: 'grossWt',
        },
        {
          title: '净重',
          minWidth: 120,
          align: 'center',
          key: 'netWt',
        },
        {
          title: '备注',
          minWidth: 120,
          align: 'center',
          key: 'note',
        },
        {
          title: '原产国(地区)',
          minWidth: 120,
          align: 'center',
          key: 'originCountry',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.country_outdated, params.row.originCountry))
          }
        },
        {
          title: '申报数量',
          minWidth: 120,
          align: 'center',
          key: 'qty',
        },
        {
          title: '法定数量',
          minWidth: 120,
          align: 'center',
          key: 'qty1',
        },
        {
          title: '法定第二数量',
          minWidth: 120,
          align: 'center',
          key: 'qty2',
        },
        {
          title: '流转申报表序号',
          minWidth: 120,
          align: 'center',
          key: 'rotateGNo',
        },
        {
          title: '序号',
          minWidth: 120,
          align: 'center',
          key: 'serialNo',
        },
        {
          title: '申报计量单位',
          minWidth: 120,
          align: 'center',
          key: 'unit',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.unit, params.row.unit))
          }
        },
        {
          title: '法定计量单位',
          minWidth: 120,
          align: 'center',
          key: 'unit1',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.unit, params.row.unit1))
          }
        },
        {
          title: '法定第二计量单位',
          minWidth: 120,
          align: 'center',
          key: 'unit2',
          render: (h, params) => {
            return h('span', this.pcodeGet(this.pcode.unit, params.row.unit2))
          }
        },
      ]
    }
  }
}
export {
  columns,
  excelColumnsConfig,
  columnsConfig
}
